<!DOCTYPE html>
<html>

{include file='public/header'}
<style>
    .layui-input-block {
        margin-left: 75px;
    }
</style>

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">记录管理</a>
            <a><cite>充值记录</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form">
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">用户ID：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="uid" placeholder="请输入用户ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">短剧ID：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="video_id" placeholder="请输入短剧ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">提交时间：</label>
                    <div class="layui-inline" id="time" style="display: flex;align-items: center;">
                        <div class="layui-input-inline" style="margin-right:10px">
                            <input type="text" autocomplete="off" name="start_date" id="start_date" class="layui-input"
                                placeholder="开始日期">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline">
                            <input type="text" autocomplete="off" name="end_date" id="end_date" class="layui-input"
                                placeholder="结束日期">
                        </div>
                    </div>
                </div>
                <button class="layui-btn" style="margin-left: 10px;" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </form>
        </div>
        <table id="watchIndex" lay-filter="watchIndex"></table>
    </div>
    <script>
        let params = {
            elem: '#watchIndex'
            , url: '/admin/record/watchList' //数据接口
            , id: 'watchIndex'
            , page: true
            , cols: [[ //表头
                { field: 'id', title: 'ID' ,width:100, align:'center'}
                , { field: 'uid', title: '用户ID' ,width:100, align:'center'}
                , { field: 'video_id', title: '短剧ID'  ,width:80, align:'center'}
                , { field: 'video_name', title: '短剧名称', align:'center' }
                , {
                    field: 'sort', title: '剧集', width: 110, templet: function (d) {
                        return `第${d.sort}集`
                    }, align:'center'
                }
                , {
                    field: 'created_at', title: '观看时间', templet: function (d) {
                        return dayjsFormat(d.created_at)
                    }, align:'center'
                }

            ]]
        }
        tableList(params)

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            //日期范围
            laydate.render({
                elem: '#time'
                , range: ['#start_date', '#end_date']
                , format: 'yyyy-MM-dd'
            });
        })
    </script>
</body>

</html>